Optimal. Leaf size=19 \[ B \log (1+\sin (x))-\frac {A \cos (x)}{1+\sin (x)} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.05, antiderivative size = 19, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 4, integrand size = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.308, Rules used = {4486, 2727,
2746, 31} \begin {gather*} B \log (\sin (x)+1)-\frac {A \cos (x)}{\sin (x)+1} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 31
Rule 2727
Rule 2746
Rule 4486
Rubi steps
\begin {align*} \int \frac {A+B \cos (x)}{1+\sin (x)} \, dx &=\int \left (\frac {A}{1+\sin (x)}+\frac {B \cos (x)}{1+\sin (x)}\right ) \, dx\\ &=A \int \frac {1}{1+\sin (x)} \, dx+B \int \frac {\cos (x)}{1+\sin (x)} \, dx\\ &=-\frac {A \cos (x)}{1+\sin (x)}+B \text {Subst}\left (\int \frac {1}{1+x} \, dx,x,\sin (x)\right )\\ &=B \log (1+\sin (x))-\frac {A \cos (x)}{1+\sin (x)}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(42\) vs. \(2(19)=38\).
time = 0.04, size = 42, normalized size = 2.21 \begin {gather*} 2 B \log \left (\cos \left (\frac {x}{2}\right )+\sin \left (\frac {x}{2}\right )\right )+\frac {2 A \sin \left (\frac {x}{2}\right )}{\cos \left (\frac {x}{2}\right )+\sin \left (\frac {x}{2}\right )} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.19, size = 35, normalized size = 1.84
method | result | size |
risch | \(-i B x -\frac {2 A}{{\mathrm e}^{i x}+i}+2 B \ln \left ({\mathrm e}^{i x}+i\right )\) | \(32\) |
default | \(-B \ln \left (1+\tan ^{2}\left (\frac {x}{2}\right )\right )-\frac {2 A}{\tan \left (\frac {x}{2}\right )+1}+2 B \ln \left (\tan \left (\frac {x}{2}\right )+1\right )\) | \(35\) |
norman | \(\frac {-2 A \left (\tan ^{2}\left (\frac {x}{2}\right )\right )-2 A}{\left (1+\tan ^{2}\left (\frac {x}{2}\right )\right ) \left (\tan \left (\frac {x}{2}\right )+1\right )}+2 B \ln \left (\tan \left (\frac {x}{2}\right )+1\right )-B \ln \left (1+\tan ^{2}\left (\frac {x}{2}\right )\right )\) | \(56\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.28, size = 24, normalized size = 1.26 \begin {gather*} B \log \left (\sin \left (x\right ) + 1\right ) - \frac {2 \, A}{\frac {\sin \left (x\right )}{\cos \left (x\right ) + 1} + 1} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.38, size = 38, normalized size = 2.00 \begin {gather*} -\frac {A \cos \left (x\right ) - {\left (B \cos \left (x\right ) + B \sin \left (x\right ) + B\right )} \log \left (\sin \left (x\right ) + 1\right ) - A \sin \left (x\right ) + A}{\cos \left (x\right ) + \sin \left (x\right ) + 1} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 94 vs.
\(2 (17) = 34\).
time = 0.28, size = 94, normalized size = 4.95 \begin {gather*} - \frac {2 A}{\tan {\left (\frac {x}{2} \right )} + 1} + \frac {2 B \log {\left (\tan {\left (\frac {x}{2} \right )} + 1 \right )} \tan {\left (\frac {x}{2} \right )}}{\tan {\left (\frac {x}{2} \right )} + 1} + \frac {2 B \log {\left (\tan {\left (\frac {x}{2} \right )} + 1 \right )}}{\tan {\left (\frac {x}{2} \right )} + 1} - \frac {B \log {\left (\tan ^{2}{\left (\frac {x}{2} \right )} + 1 \right )} \tan {\left (\frac {x}{2} \right )}}{\tan {\left (\frac {x}{2} \right )} + 1} - \frac {B \log {\left (\tan ^{2}{\left (\frac {x}{2} \right )} + 1 \right )}}{\tan {\left (\frac {x}{2} \right )} + 1} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 43 vs.
\(2 (19) = 38\).
time = 0.42, size = 43, normalized size = 2.26 \begin {gather*} -B \log \left (\tan \left (\frac {1}{2} \, x\right )^{2} + 1\right ) + 2 \, B \log \left ({\left | \tan \left (\frac {1}{2} \, x\right ) + 1 \right |}\right ) - \frac {2 \, {\left (B \tan \left (\frac {1}{2} \, x\right ) + A + B\right )}}{\tan \left (\frac {1}{2} \, x\right ) + 1} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 15.15, size = 34, normalized size = 1.79 \begin {gather*} 2\,B\,\ln \left (\mathrm {tan}\left (\frac {x}{2}\right )+1\right )-\frac {2\,A}{\mathrm {tan}\left (\frac {x}{2}\right )+1}-B\,\ln \left ({\mathrm {tan}\left (\frac {x}{2}\right )}^2+1\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________